<template>
  <!--日志-->
  <el-dialog
    title="日志"
    :visible.sync="dialogVisible6"
    width="500px" >
    <div style="max-height:300px;overflow-y: auto; padding-top: 5px;"  v-loading="listloading">
      <el-timeline >
        <el-timeline-item
          v-for="item in logs"
          :key="item.logId">
        <span v-if="type=='inquiry'">
            <span style="padding-right:10px;">{{item.logTime}}</span>
            {{item.logUserName}}：{{item.logContent}}
            <span v-show="item.remark && item.remark != ''" style="color:red;padding-left:5px">备注：{{item.remark}}</span>
        </span>
        <span v-else>
            <span style="padding-right:10px;">{{item.logTime}}</span>
            {{item.logUserName}}：{{item.logContent}}
            <span v-show="item.remark && item.remark != ''" style="color:red;padding-left:5px">备注：{{item.remark}}</span>
        </span>
        </el-timeline-item>
      </el-timeline>
      <div style="color:#888;padding:20px;text-align: center;font-size:12px" v-if="logs.length == 0">- 暂无数据 -</div>
    </div>
    <span slot="footer" class="dialog-footer" style="	display: flex;justify-content: center;
   	align-items: center;">
          <el-button @click="handleClose6">取 消</el-button>
      </span>
  </el-dialog>
</template>
<script>
import {getInquiryLog,goodsPriceLog} from '@/api/allInLine/inquiry'
import { mapGetters } from 'vuex'
export default {
  name: "index",
  data(){
    return {
      dialogVisible6:false,
      listloading:false,
      logs:[],
      type:''
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'mobile',
      'userId'
    ]),
  },
  components : {

  },
  created() {

  },
  filters: {

  },
  methods:{

    //显示日志
    showPop6(type,item){
      this.logs=[]
      this.type = type
      this.listloading = true
      this.dialogVisible6 = true;
      if(type=='goodsPrice'){
        goodsPriceLog({priceId:item.priceId}).then(res=>{
        this.listloading = false
        this.logs = res.list
      }).catch(err =>{
        this.listloading = false
      })
      }else if(type=='inquiry'){
        getInquiryLog({inquiryId:item.inquiryId}).then(res=>{
        this.listloading = false
        this.logs = res
      }).catch(err =>{
        this.listloading = false
      })
      }

    },
    //关闭日志
    handleClose6(){
      this.dialogVisible6 = false;
    },
  },
}
</script>

<style  lang="scss">

</style>
